import 'package:flutter/material.dart';
import 'package:flutter_module/global/colors.dart';
import 'package:flutter_screenutil/screen_util.dart';

showUploadDialog(BuildContext context) async {
  ScreenUtil.init(
    BoxConstraints(
        maxWidth: MediaQuery.of(context).size.width,
        maxHeight: MediaQuery.of(context).size.height),
    designSize: Size(1080, 2340),
  );
  showModalBottomSheet(
    context: context,
    builder: (BuildContext context) {
      return Container(
        color: Color(0xff000B1F),
        child: Container(
          width: double.infinity,
          height: ScreenUtil().setHeight(700),
          decoration: BoxDecoration(
            color: Color(0xff182643),
            borderRadius: BorderRadius.only(
                topLeft: Radius.circular(15), topRight: Radius.circular(15)),
          ),
          padding: EdgeInsets.only(top: ScreenUtil().setWidth(30)),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              InkWell(
                onTap: () async {
                  Navigator.pushNamed(context, 'uploadDetail');
                },
                child: Container(
                  height: ScreenUtil().setHeight(142),
                  color: Color(0xff182643),
                  child: Center(
                    child: Text(
                      '图片',
                      style: TextStyle(
                        fontSize: ScreenUtil().setSp(50),
                        color: Colors.white,
                      ),
                    ),
                  ),
                ),
              ),
              Divider(
                height: 0.5,
                color: Colors.black12,
              ),
              InkWell(
                onTap: () async {},
                child: Container(
                  height: ScreenUtil().setHeight(142),
                  color: Color(0xff182643),
                  child: Center(
                    child: Text(
                      '音乐',
                      style: TextStyle(
                        fontSize: ScreenUtil().setSp(50),
                        color: Colors.white,
                      ),
                    ),
                  ),
                ),
              ),
              Divider(
                height: 0.5,
                color: Colors.black12,
              ),
              InkWell(
                onTap: () async {},
                child: Container(
                  height: ScreenUtil().setHeight(142),
                  color: Color(0xff182643),
                  child: Center(
                    child: Text(
                      '视频',
                      style: TextStyle(
                        fontSize: ScreenUtil().setSp(50),
                        color: Colors.white,
                      ),
                    ),
                  ),
                ),
              ),
              Container(
                height: ScreenUtil().setHeight(40),
                color: AppColors.pageBackground,
              ),
              Expanded(
                child: InkWell(
                  onTap: () {
                    Navigator.pop(context);
                  },
                  child: Center(
                    child: Text(
                      '取消',
                      style: TextStyle(
                        fontSize: ScreenUtil().setSp(50),
                        color: Colors.white,
                      ),
                    ),
                  ),
                ),
              )
            ],
          ),
        ),
      );
    },
  );
}
